/*
 * Literal.java
 *
 * Created on 21 September 2005.
 */

package org.datamining.guha.model.literal;

import org.datamining.guha.model.Formatter;

/**
 * Literal represents atomic attribute.
 * It has two properties:
 * <ul>
 * <li> literal value (symbol) currently represented by int. This may change in future.</li>
 * <li> negation flag</li>
 * </ul>
 *
 * Implements Comparable so that it can be easily sorted in Arrays.
 * Natural order for "[neg]literal" is:
 * A, negA, B, negB ...
 *
 * @author Lukas Vlcek
 */
public interface Literal extends Comparable<Literal> {
    
    public int compareTo(Literal l);   
    
    public boolean equals(Object o);

    public int hashCode();
    
    /** 
     * @return Symbol value.
     */
    public int getSymbol();

    /**
     * @return true is Literal is negative.
     */
    public boolean isNegative();
    
    /**
     * @return String representation of Literal.
     */
    public String toString();
    
    public void setFormatter(Formatter<Literal> f);
    
    public Formatter<Literal> getFormatter();
}
